﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dycox.ComponentModel;
using Dycox.Workflows.Data;

namespace Dycox.Workflows
{
    public class OperationArguments : Data.DataArguments
    {
        public OperationArguments()
        {

        }

        public OperationArguments(StageContract userState)
            : this(userState, null)
        {
        }

        public OperationArguments(object dataSource)
            : this(null, dataSource)
        {

        }

        public OperationArguments(StageContract userState, object dataSource)
            : base(dataSource)
        {
            UserData = userState;

        }

        private StageContract _userData;

        public StageContract UserData
        {
            get { return _userData; }
            set { _userData = value; }
        }

        private ComponentIdentifier _componentID;

        public ComponentIdentifier ComponentID
        {
            get { return _componentID; }
            set { _componentID = value; }
        }

        public string Comment
        {
            get
            {
                if (_userData != null) return _userData.Comment;
                else return null;
            }
        }

        public string OperatorName
        {
            get
            {
                if (_userData != null) return _userData.OperatorName;
                else return null;
            }
        }

        private IReflectionRoot _reflectionTarget;

        public IReflectionRoot AppObject
        {
            get { return _reflectionTarget; }
            set { _reflectionTarget = value; }
        }

        private string _workflowName;

        public string WorkflowName
        {
            get { return _workflowName; }
            set { _workflowName = value; }
        }

        private FrameType _frameType;

        internal FrameType FrameType
        {
            get { return _frameType; }
            set { _frameType = value; }
        }

    }
}
